// .txt

beginzonescript;

variables;

short im_hostile = 0;
short last_abil;
short counter = 0;
short set_ter1 = 0;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

//	set_name(,"");

	set_attack_range(30003,5);
	set_attack_range(30005,5);
	set_attack_range(30006,5);
	set_attack_range(30011,3);
	set_attack_range(30012,3);
	
	if (difficulty() > 1) {
		set_percent_adjust(30008,3,50);
		set_percent_adjust(30008,12,50);
		}
		
	set_attitude(30011,10);
	set_attitude(30012,10);
	set_attitude(30013,10);
	if (gf(38,11) > 0) {
		erase_char(30011);
		erase_char(30012);
		erase_char(30013);
		}
	set_name(3868,"Lich of the Tower");
	set_attack_range(3868,2);
	set_boss_level(3868,2);
	
//	add_ability(short which_char_or_group,short which_slot,short which_ability,0);

//	if (is_town_clear(ME))
//		clean_up_town();
	if (gf(38,13) == 0) 
		sf(38,6,0);
	if (gf(38,13) > 0)
		erase_char(30008);
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	if ((set_ter1 == 0) && (gf(38,11) > 0)) {
		set_ter1 = 1;
		set_terrain(1,30,46,0);
		}
		
	// if (gf(,) == 0) {
	//if (get_ran(1,0,100) < 10)
	//	give_char_text_bubble(,"");
	//	}

	//if (gf(,) < 2) {
	//	inc_flag(,,1);
	//	if (gf(,) == 2)
	//		begin_talk_mode();
	//	}

	//if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_town()) && (tick_difference(last_abil,get_current_tick()) > 5))) {
	//	last_abil = get_current_tick();
	//	if ((gf(,) > 0) && (gf(,) < 100))
	//	}
break;

beginstate 10;
	sf(38,20,1);
break;

beginstate 11;
	sf(38,21,1);
	sf(38,2,1);
break;

beginstate 12;
	if (char_ok(3868))
		alert_char(3868);
	if ((gf(38,11) == 0) && (is_talking() == FALSE)) {
		sf(38,11,1);
		set_spec_item(25,1);
		begin_talk_mode(15);
		}
break;

beginstate 13;
break;

//	print_str("");
//	set_terrain_string_range(".",1);
//	set_terrain_string_range("The sign says - .",1);
